home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Today - The Disc! 5
/
CD-ROM Today - The Disc (Issue 5)(November 1994).ISO
/
mac
/
Mac shareware
/
Education
/
RLaB
/
rlib
/
tmp_file.r
< prev
next >
Wrap
Text File
|
1994-09-21
|
936b
|
38 lines
//-------------------------------------------------------------------//
// Syntax: tmp_file ( )
// Description:
// The tmp_file function generates a string, which can be used as a
// temporary file name. The tmp_file function generates the file name
// with the help of the system's date program. If your particular
// platform does not support the date usage as delivered, then modify
// the argument to system() to get the correct effect.
//-------------------------------------------------------------------//
static (K); // to help insure unique name during a session
K = 1;
tmp_file = function ( )
{
local (ans, k, pfile, sans);
//
// Generate a date string that looks like hhmmss. That is
// numerical hour, minutes, seconds.
//
pfile = "|date +%H%M%S";
ans = getline (pfile);
close (pfile);
sprintf (sans, "%i", ans.[1]);
sprintf (k, "%i", K);
K++;
return "rlab-" + sans + "." + k;
};